package com.woniu.woniuYoga.config;

import org.springframework.stereotype.Component;
import springfox.documentation.swagger.web.SwaggerResource;
import springfox.documentation.swagger.web.SwaggerResourcesProvider;

import java.util.Arrays;
import java.util.List;

/**
 * @author: 付宽成
 * @description: 配置 Swagger下拉列表的资源信息
 * @date: 2020/8/25 19:38
 * @version: 1.0
 */

@Component
public class ResourceProvider implements SwaggerResourcesProvider {

    @Override
    public List<SwaggerResource> get() {
        return Arrays.asList(
//            createSwaggerResource("瑜伽学员","/student-server/v2/api-docs","2.0"),
            createSwaggerResource("瑜伽教练-付宽成","/teacher-server/v2/api-docs","2.0"),
            createSwaggerResource("瑜伽场馆-杜鑫","/gym-server/v2/api-docs","2.0"),
            createSwaggerResource("平台-曹力引","/backstage-server/v2/api-docs","2.0")
        );
    }

    private SwaggerResource createSwaggerResource(String name,String url,String version){
        SwaggerResource resource = new SwaggerResource();
        resource.setName(name);
        resource.setUrl(url);
        resource.setSwaggerVersion(version);
        return resource;
    }
}
